package com.hx.zhg.web.help;


import com.hx.zhg.service.seo.constant.SeoIndicator;
import com.hx.zhg.service.seo.vo.MetaInfoVo;

import javax.servlet.http.HttpServletRequest;

/**
 * SEO 设置
 */
public class SeoHandleHelp {

    /**
     * 设置seo meta标签数据
     *
     * @param metaInfo
     */
    public static void setMetaInfo(MetaInfoVo metaInfo) {
        String keyWords = SeoIndicator.GLOBAL_SITE_PREFIX + metaInfo.getKeyWords();
        String description = metaInfo.getDescription();
        HttpServletRequest request = ServletContextEnvHelp.getRequestInstance();
        request.setAttribute(SeoIndicator.KEY_WORDS, keyWords);
        request.setAttribute(SeoIndicator.DESCRIPTION, description);
    }
}
